package cn.iocoder.yudao.module.scenic.controller.app.road;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.scenic.controller.admin.trip.vo.TripRespVO;
import cn.iocoder.yudao.module.scenic.controller.app.road.vo.RoadTripRespVO;
import cn.iocoder.yudao.module.scenic.controller.app.road.vo.RoadTripVO;
import cn.iocoder.yudao.module.scenic.dal.dataobject.trip.TripDO;
import cn.iocoder.yudao.module.scenic.service.trip.TripService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

/**
 * @author chenglong.ai
 * @version 1.0
 * @package cn.iocoder.yudao.module.scenic.controller.app.road
 * @date 2024/06/04 01:45:04
 * @description
 */
@Tag(name = "小程序 - 线路")
@RestController
@RequestMapping("/scenic/trip")
@Validated
public class AppRoadTripController {
    @Resource
    private TripService tripService;

    @GetMapping("/findByDeptId")
    @Operation(summary = "根据组织机构获取线路")
    @Parameter(name = "deptId", description = "编号", required = true, example = "102")
    public CommonResult<List<RoadTripRespVO>> findByDeptId(@RequestParam("deptId") Long id) {
        List<RoadTripRespVO> trip = tripService.findByDeptId(id);
        return success(trip);
    }
}
